<?php
declare (strict_types=1);

namespace app\admin\model;

use app\common\model\Agreement as AgreementModel;

/**
 * 协议条款模型
 * Class Agreement
 * @package app\admin\model
 */
class Agreement extends AgreementModel
{
    public function setContentAttr($value)
    {
        return set_content_html($value);
    }
    /**
     * 获取列表
     * @param array $param
     * @return \think\Paginator
     */
    public function getList()
    {
        return $this->field('id,name,title,remark')->order([$this->getPk()])
            ->select();
    }

    /**
     * 添加新记录
     * @param $data
     * @return bool
     */
    public function add($data): bool
    {
        return $this->save($data);
    }
    
    /**
     * 编辑记录
     * @param array $data
     * @return bool
     */
    public function edit(array $data): bool
    {
        return $this->save($data);
    }
}
